import 'package:thinking/config/_.dart';

class HistorySplashEntity {
  int? _code;
  List<HistorySplashItem>? _data;
  String? _message;

  HistorySplashEntity({int? code, List<HistorySplashItem>? data, String? message}) {
    this._code = code;
    this._data = data;
    this._message = message;
  }

  int? get code => _code;
  set setCode(int code)=>_code = code;
  String? get message => _message;
  set setMessage(String message) => _message = message;
  List<HistorySplashItem>? get data =>_data;
  set getData(List<HistorySplashItem> data) => _data = data;

  HistorySplashEntity.fromJson(Map<String,dynamic> json){
    _code = json['code'];
    if (json['data'] != null) {
      _data = [];
      json['data'].forEach((v) {
        _data!.add( HistorySplashItem.fromJson(v));
      });
    }
    _message = json['message'];

  }

  Map<String,dynamic> toJson(){
    final Map<String,dynamic> data = new Map<String,dynamic>();
    data['code'] = this._code;
    data['message'] = this._message;
    data['data'] = _data != null ? _data!.map((e) => e.toJson()).toList():null;

    return data;
  }

}


class HistorySplashItem{

  int? _id;
  String? _title;
  String? _dateTime;
  String? _content;
  String? _image;

  HistorySplashItem({int? id, String? title,String? dateTime,String? content,String? image}) {
    this._id = id;
    this._title = title;
    this._dateTime = dateTime;
    this._content = content;
    this._image = image;
  }

  int? get id => _id;
  set setId(int id)=>_id = id;
  String? get title => _title;
  set setTitle(String title) => _title = title;
  String? get dateTime => _dateTime;
  set setDateTime(String dateTime) => _dateTime = dateTime;
  String? get content => _content;
  set setContent(String content) => _content = content;
  String? get image => _image;
  set setImage(String image) => _image = image;

  HistorySplashItem.fromJson(Map<String,dynamic> json){
    _id = json['id'];
    _title = json['title'];
    _dateTime = json['dateTime'];
    _content = json['content'];
    _image = Config.apiUrl['BasePhotoUrl'] + json['image'];

  }

  Map<String,dynamic> toJson(){
    final Map<String,dynamic> data = new Map<String,dynamic>();
    data['id'] = this._id;
    data['title'] = this._title;
    data['dateTime'] = this._dateTime;
    data['content'] = this._content;
    data['image'] = this._image;

    return data;
  }

}